package com.example.demo.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: DELL
 * Date: 2023-05-20
 * Time: 21:14
 */

@Controller
public class ControllerDemo {

    @RequestMapping("/getHtml/test2")
    public String getHtml() {
        return "/spring.html";
    }

    // 请求重定向
    @RequestMapping("/re")
    public String index() {
        return "redirect:/spring.html";
    }

    // 请求转发
    @RequestMapping("/fw")
    public String index2() {
        return "forward:/spring.html";
    }


}

